package com.augn.controller;

import com.augn.entity.Cart;
import com.augn.entity.Collection;
import com.augn.entity.Result;
import com.augn.service.ICollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author augn
 * @since 2022-09-22
 */
@RestController
@RequestMapping("/collection")
public class CollectionController {

    @Autowired
    private ICollectionService service;

    @PostMapping("/insertOne")
    public Result<?> insertOneCollection(@RequestBody Collection collection) {
        return service.insertOneCollection(collection);
    }

    @DeleteMapping("/deleteOne/{id}")
    public Result<?> deleteOneCollection(@PathVariable Integer id) {
        return service.deleteOneCollection(id);
    }

    @GetMapping("/getPart/{id}")
    public Result<?> getPartCollection(@PathVariable Integer id){
        return service.getPartCollection(id);
    }
}
